# n  a  b
# 2  1  1
# 3  1  2
# 4  2  3
# 5  3  5
# 6  4  8

# n 为第几个数
def fib(n):
    a,b = 0,1
    for _ in range(n):
        # 返回值为上一个 b 的值的迭代器
        yield b
        # 表示 b 值赋给 a ；a+b 值赋给 b（为下一次迭代输出）
        a, b = b , a+b


iter = fib(10)
for i in iter:
    print(i , end='\t')

print()



# def fei(a):
#     # 返回第一的个数，
#     if a == 1:
#         # raise BaseException('数列的序号要从0开始')
#         return 1
#     # 返回第二的个数，
#     elif a == 2:
#         return 1
#     else:
#         # 递归运行上一个值的上两个值的和
#         return fei(a - 1) + fei(a - 2)
#
# for i in range(4):
#     print(fei(i))










list1 = ['张三','李四','王五']
list2 = [90,92,88]
list3 = ['爱好','爱好','爱好']
list4 = ['篮球','足球','排球']
z1 = zip(list1,list2,list3,list4)
for s in z1:
    for j in range(len(s)):
        if j % 2 == 0:
            print(s[j],end=': ')
        else:
            print(s[j],end='  ')
    print()

# for name,score in z1:
#     print(f'{name}: {score}')
